package com.java.zhuiyun.api.article.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.java.zhuiyun.api.article.entity.Article;
import com.java.zhuiyun.api.article.mapper.ArticleMapper;
import com.java.zhuiyun.api.article.service.IArticleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.mail.SimpleMailMessage;
import org.springframework.mail.javamail.JavaMailSender;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * @ClassName ArticleServiceImpl
 * @Description TODO
 * @Author xy
 * @Date 2023/9/13 8:59
 **/
@Service
public class ArticleServiceImpl extends ServiceImpl<ArticleMapper, Article> implements IArticleService {

    @Resource
    private ArticleMapper articleMapper;

    @Override
    public boolean saveArticle(Article article) {
        if (article.getId() == null){
            return save(article);
        }else {
            return updateById(article);
        }
    }

}
